package com.gsn.poker.play;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.gsn.desktop.engine.ActorUtility;
import com.gsn.engine.tween.ActorAccessor;
import com.gsn.engine.tween.GsnTween;
import com.gsn.poker.game.MyPoker;

import aurelienribon.tweenengine.Timeline;
import aurelienribon.tweenengine.Tween;
import aurelienribon.tweenengine.equations.Back;
import aurelienribon.tweenengine.equations.Elastic;
import aurelienribon.tweenengine.equations.Quart;

public class EffectTween {
	public static Timeline showDialog(Actor actor){
		return Timeline.createParallel().beginParallel()
		.push(Tween.to(actor, ActorAccessor.CPOS_XY, 0.5f).target(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2))
		.push(Tween.to(actor, ActorAccessor.SCALE_XY, 0.5f).target(1, 1).ease(Quart.OUT))
		//.push(Tween.to(actor, ActorAccessor.SCALE_XY, 0.5f).target(1, 1).ease(Elastic.INOUT))
		
		.end()
		.start(MyPoker.game.tweenManger);
	}
	
	public static Timeline hideDialog(Actor actor){
		ActorUtility.setCenter(actor, Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2);
		return Timeline.createParallel().beginParallel()
		.push(Tween.to(actor, ActorAccessor.SCALE_XY, 0.5f).target(0.1f, 0.1f).ease(Quart.IN))
		.push(Tween.to(actor, ActorAccessor.CPOS_XY, 0.5f).target(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2))		
		.end()
		.start(MyPoker.game.tweenManger);
	}
}
